package com.huawei.appmarket.framework.widget.spinner;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView.LayoutParams;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.List;
import o.dky.c;
import o.dky.i;
import o.evf;

public class SpinnerAdapter extends ArrayAdapter<String> {
    private Context mContext;

    static class d {
        private TextView ˎ;

        private d() {
        }
    }

    public SpinnerAdapter(@NonNull Context context, @NonNull List<String> list) {
        super(context, i.ˊˋ, list);
        this.mContext = context;
    }

    public View getDropDownView(int i, @Nullable View view, @NonNull ViewGroup viewGroup) {
        String str = (String) getItem(i);
        View inflate = LayoutInflater.from(this.mContext).inflate(i.ˋˊ, null);
        TextView textView = (TextView) inflate.findViewById(16908308);
        textView.setLayoutParams(new LayoutParams(-1, this.mContext.getResources().getDimensionPixelSize(c.ʽॱ)));
        textView.setText(str);
        return inflate;
    }

    @NonNull
    public View getView(int i, @Nullable View view, @NonNull ViewGroup viewGroup) {
        d dVar;
        String str = (String) getItem(i);
        if (view == null || !(view.getTag() instanceof d)) {
            view = LayoutInflater.from(this.mContext).inflate(i.ˊˋ, null);
            d dVar2 = new d();
            dVar2.ˎ = (TextView) view.findViewById(16908308);
            dVar2.ˎ.setPadding(0, 0, 0, 0);
            view.setTag(dVar2);
            evf.ˋ(dVar2.ˎ, o.dky.d.ʿ);
            dVar = dVar2;
        } else {
            dVar = (d) view.getTag();
        }
        dVar.ˎ.setText(str);
        return view;
    }
}
